import http from '@/utils/httpRequest'

export default {

  /**
   * 聚水潭记录
   */
  jstRecord (param) {
    return http.get(http.adornUrl('admin/order/jst/list'), {
      params: param
    })
  },

  /**
   * 聚水潭记录订单详情
   */
  jstRecordDetail (id) {
    return http.get(http.adornUrl(`admin/order/jst/info/${id}`))
  },

  // ------寄售------
  /** 寄售主页：http */
  wholesaleList (param) {
    return http.get(http.adornUrl(`order/wholesale/list`), {
      params: param
    })
  },

  /** 更新寄售状态 */
  wholesaleUpdateStatus () {
    return http.get(http.adornUrl(`/order/wholesale/test_task`))
  },

  /** 寄售退款 */
  wholesaleRefundSave (param) {
    return http.post(http.adornUrl(`order/wholesale/refundSave`), param)
  },
  // 自动寄售日志列表
  autoWholesaleList (param) {
    return http.get(http.adornUrl(`wholesa/log/autioWhsuccess`), {
      params: param
    })
  },
  /** 寄售成功 */
  wholesaleWsSave (param) {
    return http.post(http.adornUrl(`/order/wholesale/wsSave`), param)
  },
  /** 出售 */
  sellGoodsList (param) {
    return http.post(http.adornUrl(`/order/wholesale/sell`), param)
  },
  /** 寄售记录 */
  logList (param) {
    return http.get(http.adornUrl(`wholesa/log/list/${param}`))
  },
  /** 批发订单 */
  orderWholesaleList (param) {
    // return http.get(http.adornUrl(`/order/wholesale/list`), { params: param });
    return http.get(http.adornUrl(`/order/goods/expWhoOrderList`), {
      params: param
    })
  },
  /** 批发 提货管理 */
  adpklist (param) {
    return http.get(http.adornUrl(`order/wholesale/adpklist`), {
      params: param
    })
  },
  /** 批发订单详情 */
  orderWholesaleInfo (param) {
    return http.get(http.adornUrl(`order/wholesale/info/${param}`))
  },
  /** 批发订单发货 */
  confirmGoods (param) {
    return http.post(http.adornUrl(`order/wholesale/deliver`), param)
  },
  /** 获取活动批次 */
  activitySelectList (param) {
    return http.post(http.adornUrl(`sysAdmin/activitySelectList`), param)
  },
  processConsign (param) {
    return http.post(http.adornUrl(`order/wholesale/processConsign`), param)
  },

  /** 得到某订单相关的分润信息 */
  getProfitByOrder (param) {
    return http.post(http.adornUrl(`order/getProfitByOrder`), param)
  },
  /**
  * 商家查看订单列表
  * */
  shopOrderList (param) {
    return http.get(http.adornUrl(`admin/saleorder/shop/page`), {
      params: param
    })
  },

  /**
   * 批量更新物流信息
   * */
  batchToUpdateLogisticInfo () {
    return http.post(http.adornUrl(`admin/saleorder/batch-to-update-logistic-info`), {
      params: { }
    })
  },

  /**
   * 所有订单的导出
   * */
  allOrderExport (param) {
    return http.get(http.adornUrl(`admin/saleorder/export`), {
      params: param,
      responseType: 'blob'
    })
  },

  /**
   * 待发货订单的导出
   * */
  deliveryOrderExport (param) {
    return http.get(http.adornUrl(`admin/saleorder/export/waitship`), {
      params: param,
      responseType: 'blob'
    })
  },

  /**
  * 商家查看订单列表
  * */
  orderInfo (id) {
    return http.get(http.adornUrl(`admin/saleorder/shop/info/${id}`))
  },
/**
  * 区域代理查看订单
  * */
  // orderDetail (id) {
  //   return http.get(http.adornUrl(`admin/saleorder/info/${id}`))
  // },
  /*
  * 商家未收货直接发起退款
  * */
  orderRefund (id) {
    return http.post(http.adornUrl(`admin/rights/launch/${id}`))
  },

  /**
  * 物流公司列表
  * */
  goodStreamList (id) {
    return http.get(http.adornUrl('admin/logistics/company/select'))
  },
  /*
  * 发货
  * */
  delivery (param) {
    return http.post(http.adornUrl('admin/order/package/express'), param)
  },

  /**
  * 修改发货信息
  * */
  updateDelivery (param) {
    return http.post(http.adornUrl('admin/order/package/express/update'), param)
  },

  /*
  * 备货
  * */
  stockUp (param) {
    return http.post(http.adornUrl('admin/order/package/pickup'), param)
  },
  /*
  * 商家核销自提订单
  * */
  verification (param) {
    return http.post(http.adornUrl('admin/order/package/verification'), param)
  },

  /**
  * 物流详情
  * */
  goodStreamDetail (orderId, id) {
    return http.get(http.adornUrl(`admin/order/package/express/select/${orderId}/${id}`))
  },

  /*
  * 分包发货提交
  * */
  subpackageShipmentsSubmit (param) {
    return http.post(http.adornUrl('admin/order/package/partexpress'), param)
  },

  /**
  * 包裹详情
  * */
  subpackageGoodsDetail (id) {
    return http.get(http.adornUrl(`admin/order/package/allpackage/${id}`))
  },

  /**
  * 商家查看订单的发货包裹数据
  * */
  deliveryDetail (orderId, id) {
    return http.get(http.adornUrl(`admin/order/package/info/${orderId}/${id}`))
  },

  /**
  * 售后订单列表查询
  * */
  afterSaleList (param) {
    return http.get(http.adornUrl('admin/rights/page'), {
      params: param
    })
  },

  /**
  * 售后订单详情
  * */
  afterSaleDetail (id) {
    return http.get(http.adornUrl(`admin/rights/info/${id}`))
  },

  /*
  * 商家同意退款/退货
  * */
  agree (param) {
    return http.post(http.adornUrl('admin/rights/agree'), param)
  },
  /*
  * 商家拒绝退款/退货
  * */
  refuse (param) {
    return http.post(http.adornUrl('admin/rights/refuse'), param)
  },

  /*
  * 商家撤销维权
  * */
  revokeRights (param) {
    return http.post(http.adornUrl('admin/rights/cancel/' + param.user_id + '/' + param.rights_order_id))
  },

  /*
  * 商家收货
  * */
  receipt (param) {
    return http.post(http.adornUrl('admin/rights/receipt'), param)
  },

  /*
  * 商家退款
  * */
  refund (param) {
    return http.post(http.adornUrl('admin/rights/refund'), param)
  },
  // 商家手动为单品增加库存
  postSinglegoodsManualInStock (param) {
    return http.post(http.adornUrl('admin/rights/instock'), param)
  },
  /*
  * 商家查看退货发货物流跟踪
  * */
  viewLogistics (id) {
    return http.get(http.adornUrl(`admin/rights/express/select/${id}`))
  },

  /**
  * 订单商品改价
  * */
  updatePrice (param) {
    return http.put(http.adornUrl('admin/saleorder/update/price'), param)
  },

  /**
  * 平台管理 查询所有商品订单
  * */
  platformViewOrder (param) {
    return http.get(http.adornUrl('admin/saleorder/all/page'), {
      params: param
    })
  },

  /**
  * 平台管理 查询商品订单详情
  * */
  platformOrderInfo (id) {
    return http.get(http.adornUrl(`admin/saleorder/info/${id}`))
  },

  /**
  * 平台管理 查询充值商品订单
  * */
  platformTopupOrder (param) {
    return http.get(http.adornUrl('admin/order/refillcard/list'), {
      params: param
    })
  },

  /**
  * 平台管理 查询充值商品订单详情
  * */
  topupOrderDetail (id) {
    return http.get(http.adornUrl(`admin/order/refillcard/info/${id}`))
  },
  // 通过核销码查询订单
  verficationApi (param) {
    return http.post(http.adornUrl('admin/order/package/getorder-by-verification'), param)
  },

  /** 商家查看服务订单订单列表 */
  shopServicePage (param) {
    return http.get(http.adornUrl(`admin/saleorder/shop/service/page`), {
      params: param
    })
  },

  /** 平台查看服务订单订单列表 */
  saleOrderAll (param) {
    return http.get(http.adornUrl(`admin/saleorder/service/all/page`), {
      params: param
    })
  },
  /** 服务核销 */
  sgoodsverificationCheck (param) {
    return http.post(http.adornUrl('admin/sgoodsverification/check'), param)
  },
  /** 查询核销订单 */
  sgoodsverificationLoadorder (param) {
    return http.get(http.adornUrl(`admin/sgoodsverification/loadorder/${param}`))
  },
  // 查询订单的核销记录
  sgoodsverificationList (params1, params2) {
    return http.get(http.adornUrl(`admin/sgoodsverification/list/${params1}/${params2}`))
  },
  sgoodsverificationRenewal (param) {
    return http.post(http.adornUrl('admin/sgoodsverification/renewal'), param)
  },
  rightsLaunch (param) {
    return http.post(http.adornUrl('admin/rights/launch/service'), param)
  },
  /**
  * 线上商家订单
  * */
  areaagentOrderList (param) {
    return http.get(http.adornUrl(`admin/saleorder/areaagent/page`), {
      params: param
    })
  }
}
